package com.gujiangbo.redemo;

import redis.clients.jedis.Jedis;

import java.util.UUID;

public class RedisClientTest {

    public static void main(String[] args) throws InterruptedException {
        Jedis jedis = new Jedis("127.0.0.1", 6379);
        jedis.select(0);
        int i = 1000;
        for (; ; ) {
            Thread.sleep(500);
            jedis.set("userId-" + (i++), UUID.randomUUID().toString().
                    replace("-", "").substring(0, 8), "NX", "EX", 20);
            System.out.println(i);
        }


    }
}
